﻿<%@ Page Title="Edit Trip" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="EditTrip.aspx.cs" Inherits="TravelAgency.AspNet.Agents.EditTrip" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" 
                Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" 
                Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" 
                Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    
    <div class="top-padding"><h2>Edit Trip</h2></div>

    <asp:Panel ID="PanelTrip" runat="server" CssClass="trip-details">
    
        <asp:Panel runat="server" ID="PanelTripDetails">

            <h2>Trip details</h2>

            <table>
                <tr>
                    <td><b>Title:</b></td>
                    <td><asp:TextBox ID="TextBoxTitle" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="TextBoxTitle" CssClass="message-error" Display="Dynamic" 
                            ErrorMessage="Required field" ToolTip="Required field">Required field</asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                            ControlToValidate="TextBoxTitle" CssClass="message-error" Display="Dynamic" 
                            ErrorMessage="Title too long" ToolTip="Title too long" 
                            ValidationExpression=".{1,200}">Title too long</asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td><b>Start date:</b></td>
                    <td>
                        <telerik:RadDatePicker ID="RadDatePickerStartDate" Runat="server" 
                            Culture="bg-BG" Width="183px">
                        </telerik:RadDatePicker>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                            ControlToValidate="RadDatePickerStartDate" CssClass="message-error" 
                            Display="Dynamic" ErrorMessage="Reuired field">Reuired field</asp:RequiredFieldValidator>
                        <asp:CustomValidator ID="CustomValidatorStartDate" runat="server" 
                            ControlToValidate="RadDatePickerStartDate" CssClass="message-error" 
                            Display="Dynamic" ErrorMessage="Invalid date range" 
                            onservervalidate="CustomValidatorStartDate_ServerValidate">Invalid date range</asp:CustomValidator>
                    </td>
                </tr>
                <tr>
                    <td><b>End date:</b></td>
                    <td>
                        <telerik:RadDatePicker ID="RadDatePickerEndDate" Runat="server" Culture="bg-BG" 
                            Width="183px">
                        </telerik:RadDatePicker>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                            ControlToValidate="RadDatePickerEndDate" CssClass="message-error" 
                            Display="Dynamic" ErrorMessage="Reuired field">Reuired field</asp:RequiredFieldValidator>
                        <asp:CustomValidator ID="CustomValidatorEndDate" runat="server" 
                            ControlToValidate="RadDatePickerEndDate" CssClass="message-error" 
                            Display="Dynamic" ErrorMessage="CustomValidator" 
                            onservervalidate="CustomValidatorEndDate_ServerValidate">Invalid date range</asp:CustomValidator>
                    </td>
                </tr>
                <tr>
                    <td><b>Price:</b></td>
                    <td><asp:TextBox runat="server" ID="TextBoxPrice"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="TextBoxPrice" CssClass="message-error" Display="Dynamic" 
                            ErrorMessage="Required field" ToolTip="Required field">Required field</asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="RangeValidator1" runat="server" 
                            ControlToValidate="TextBoxPrice" CssClass="message-error" Display="Dynamic" 
                            ErrorMessage="Wrong format (format example - 123,0) or too big" 
                            MaximumValue="100000" MinimumValue="0" Type="Double">Wrong format (format example - 123,0) or too big</asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td><b>People count:</b></td>
                    <td><asp:TextBox runat="server" ID="TextBoxPeopleCount" Enabled="False" 
                            ReadOnly="True"></asp:TextBox></td>
                </tr>
                <tr>
                    <td><b>Maximum people count:</b></td>
                    <td><asp:TextBox runat="server" ID="TextBoxMaxPeopleCount"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                            ControlToValidate="TextBoxMaxPeopleCount" CssClass="message-error" 
                            Display="Dynamic" ErrorMessage="Required field" ToolTip="Required field">Required field</asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="RangeValidatorPeopleCount" runat="server" 
                            CssClass="message-error" ErrorMessage="RangeValidator" 
                            MaximumValue="10000" ControlToValidate="TextBoxMaxPeopleCount" 
                            Type="Integer">Enter bigger count</asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td><b>Description:</b></td>
                    <td><asp:TextBox ID="TextBoxDescription" runat="server" 
                        Width="740px" Height="171px" TextMode="MultiLine"></asp:TextBox>
                        <br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="TextBoxDescription" CssClass="message-error" Display="Dynamic" 
                            ErrorMessage="Required field">Required field</asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                            ControlToValidate="TextBoxDescription" CssClass="message-error" Display="Dynamic" 
                            ErrorMessage="Too long" ValidationExpression=".{1,4000}">Too long</asp:RegularExpressionValidator>
                    </td>
                </tr>
            </table>
            <div class="link-resevation">                        
                <asp:LinkButton ID="LinkButtonReservation" runat="server" 
                    Text="Update" onclick="LinkButtonUpdate_Click"></asp:LinkButton> /
                <asp:LinkButton ID="LinkButtonCancelReservation" runat="server" 
                    CausesValidation="false" Text="Cancel" 
                    onclick="LinkButtonCancelReservation_Click"></asp:LinkButton>
            </div>   
        </asp:Panel>        
    </asp:Panel>
    <br />
</asp:Content>
